object DataModule1: TDataModule1
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  Height = 509
  Width = 912
  object FIBMESDataBase: TpFIBDatabase
    Connected = True
    DBName = 'localhost/3055:stacmes'
    DBParams.Strings = (
      'lc_ctype=WIN1251'
      'user_name=sysdba'
      'password=masterkey'
      'sql_role_name=')
    DefaultTransaction = FIBReadT
    DefaultUpdateTransaction = FIBWriteT
    SQLDialect = 3
    Timeout = 0
    LibraryName = 'c:\Program Files\Firebird\Firebird_2_1\bin\fbclient.dll'
    WaitForRestoreConnect = 0
    BeforeConnect = FIBMESDataBaseBeforeConnect
    AfterConnect = FIBMESDataBaseAfterConnect
    Left = 32
    Top = 8
  end
  object FIBMESDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    M.ID_MES,'
      
        '    M.MES_LEVEL ||'#39' '#39'|| P.CODE ||'#39' '#39'|| M.MES_AGE ||'#39' '#39'|| M.MES_N' +
        'UM as MES,'
      '    M.MES_LEVEL || P.CODE || M.MES_AGE || M.MES_NUM as fMES,'
      '    M.KCK,'
      '    M.SROK,'
      '    M.DATE_PR,'
      '    M.NOMER_PR,'
      '    M.DATE_END,'
      '    case M.STATUS_FLAG'
      '        when 0 then '#39#1044#1077#1081#1089#1090#1074#1091#1102#1097#1080#1081#39
      '        when 1 then '#39#1053#1077' '#1091#1090#1074#1077#1088#1078#1076#1105#1085#39
      '        when 3 then '#39#1059#1076#1072#1083#1105#1085#39
      '        else '#39#1057#1090#1072#1090#1091#1089' '#1085#1077' '#1086#1087#1088#1077#1076#1077#1083#1105#1085#39
      '    end,'
      '    M.STATUS_FLAG,'
      '    K.NAME  as KOEK'
      'FROM'
      '    MES M '
      'join PROFILE_CODE P on (M.MES_CODE=P.ID)'
      'left join S_KOEK K on (M.KOEK_ID=K.ID)'
      
        'ORDER BY M.STATUS_FLAG, M.MES_CODE, M.MES_LEVEL, M.MES_AGE, MES_' +
        'NUM')
    Active = True
    AfterOpen = FIBMESDSetAfterOpen
    AfterScroll = FIBMESDSetAfterScroll
    Transaction = FIBReadT
    Database = FIBMESDataBase
    Left = 104
    Top = 56
  end
  object FIBCelGospDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    S.NAME, C.ID'
      'FROM'
      '    CEL_GOSP C'
      'JOIN S_CEL_GOSP S ON (C.ID_CEL_GOSP=S.ID)'
      'WHERE C.ID_MES = :ID_MES'
      'ORDER BY C.NOM_IN_MES')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    DataSource = MesDS
    Left = 192
    Top = 56
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBKOEKDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME'
      'FROM'
      '    S_KOEK ')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    Left = 280
    Top = 56
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBKRKACHDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    S.NAME, K.ID'
      'FROM'
      '    KR_KACH K'
      'JOIN S_KR_KACH S ON (K.ID_KR_KACH=S.ID)'
      'WHERE K.ID_MES = :ID_MES'
      'ORDER BY K.NOM_IN_MES')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    DataSource = MesDS
    Left = 360
    Top = 56
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBMKBDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '  S.KOD_MKB,'
      '  S.NAME, M.ID '
      'FROM'
      '    MKB M join S_MKB S on (M.HASH_MKB = S.HASH_MKB)'
      'WHERE M.ID_MES = :ID_MES')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    DataSource = MesDS
    Left = 440
    Top = 56
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBVALLECHDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    S.NAME, V.ID'
      'FROM'
      '    VAL_LECH V'
      'JOIN S_VAL_LECH S ON (V.ID_VAL_LECH=S.ID)'
      'WHERE V.ID_MES = :ID_MES'
      'ORDER BY V.NOM_IN_MES')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    DataSource = MesDS
    Left = 520
    Top = 56
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBSPECDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    S.NAME, C.ID'
      'FROM'
      '    SPEC C'
      'JOIN S_SPEC S ON (C.ID_SPEC=S.ID)'
      'WHERE C.ID_MES = :ID_MES'
      'ORDER BY C.NOM_IN_MES')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    DataSource = MesDS
    Left = 608
    Top = 56
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBOBSLEDDset: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    S.NAME, O.ID'
      'FROM'
      '    OBSLED O'
      'JOIN S_OBSLED S ON (O.ID_OBSLED=S.ID)'
      'WHERE O.ID_MES = :ID_MES'
      'ORDER BY O.NOM_IN_MES')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    DataSource = MesDS
    Left = 696
    Top = 56
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBWriteT: TpFIBTransaction
    DefaultDatabase = FIBMESDataBase
    TimeoutAction = TARollback
    TRParams.Strings = (
      'write'
      'nowait'
      'read_committed'
      'rec_version')
    TPBMode = tpbDefault
    Left = 56
    Top = 256
  end
  object FIBReadT: TpFIBTransaction
    Active = True
    DefaultDatabase = FIBMESDataBase
    TimeoutAction = TARollback
    TRParams.Strings = (
      'read'
      'isc_tpb_nowait'
      'read_committed'
      'rec_version')
    TPBMode = tpbDefault
    Left = 120
    Top = 256
  end
  object FIBWorkDSet: TpFIBDataSet
    SelectSQL.Strings = (
      
        'SELECT M.ID_MES, M.MES_LEVEL, M.MES_CODE, M.MES_AGE, M.MES_LEVEL' +
        ' || P.CODE'
      '         || M.MES_AGE || M.MES_NUM as fMES, '
      
        '         M.STATUS_FLAG FROM MES M JOIN PROFILE_CODE P on (M.MES_' +
        'CODE=P.CODE)'
      '         join group_items G on (G.id_mes=M.id_mes)'
      '         where g.id_group=:id_group order by 2, 3')
    Active = True
    Transaction = FIBReadT
    Database = FIBMESDataBase
    Left = 720
    Top = 184
    WaitEndMasterScroll = True
    dcForceMasterRefresh = True
    dcForceOpen = True
  end
  object FIBWorkQ: TpFIBQuery
    Transaction = FIBWriteT
    Database = FIBMESDataBase
    Left = 856
    Top = 184
  end
  object MesDS: TDataSource
    DataSet = FIBMESDSet
    Left = 104
    Top = 120
  end
  object CelGospDS: TDataSource
    DataSet = FIBCelGospDSet
    Left = 192
    Top = 120
  end
  object KOEKDS: TDataSource
    DataSet = FIBKOEKDSet
    Left = 280
    Top = 120
  end
  object KRKACHDS: TDataSource
    DataSet = FIBKRKACHDSet
    Left = 360
    Top = 120
  end
  object MKBDS: TDataSource
    DataSet = FIBMKBDSet
    Left = 440
    Top = 120
  end
  object VALLECHDS: TDataSource
    DataSet = FIBVALLECHDSet
    Left = 520
    Top = 120
  end
  object SPECDS: TDataSource
    DataSet = FIBSPECDSet
    Left = 608
    Top = 120
  end
  object OBSLEDDS: TDataSource
    DataSet = FIBOBSLEDDset
    Left = 696
    Top = 120
  end
  object WorkDS: TDataSource
    DataSet = FIBWorkDSet
    Left = 720
    Top = 248
  end
  object FIBDBFReadSnapT: TpFIBTransaction
    DefaultDatabase = FIBMESDataBase
    TimeoutAction = TARollback
    TRParams.Strings = (
      'read'
      'nowait'
      'concurrency')
    TPBMode = tpbDefault
    Left = 288
    Top = 320
  end
  object FIBMESScripter: TpFIBScripter
    Database = FIBMESDataBase
    Transaction = FIBWriteT
    Left = 128
    Top = 8
  end
  object FIBGroupsDSet: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID_GROUP,'
      '    G_LABEL,'
      '    BEGIN_DATE,'
      '    DATE_,'
      '    G_REMARK    '
      'FROM'
      '    S_GROUP'
      'ORDER BY G_LABEL')
    Transaction = FIBReadT
    Database = FIBMESDataBase
    Left = 784
    Top = 56
  end
  object GroupsDS: TDataSource
    DataSet = FIBGroupsDSet
    Left = 784
    Top = 120
  end
  object FIBreadQ: TpFIBQuery
    Transaction = FIBReadT
    Database = FIBMESDataBase
    Left = 792
    Top = 184
  end
  object FibErrorHandler1: TpFibErrorHandler
    OnFIBErrorEvent = FibErrorHandler1FIBErrorEvent
    Left = 400
    Top = 328
  end
  object FIBMESEventer: TSIBfibEventAlerter
    Events.Strings = (
      'MES_UPDATE')
    OnEventAlert = FIBMESEventerEventAlert
    Database = FIBMESDataBase
    AutoRegister = True
    Left = 496
    Top = 328
  end
  object FIBDBFExQ: TpFIBQuery
    Transaction = FIBDBFReadSnapT
    Database = FIBMESDataBase
    Left = 288
    Top = 264
  end
end
